package cn.six1943.deepchat.module.ai.agent;

/**
 * LLM消息处理器
 */
public interface ChatHandler {

    //消息开始
    void onStart(Long sessionId, Long messageId);

    default void onStep(Long sessionId, Long messageId, AgentStep step) {

    }

    //消息接收
    void onChunk(Long sessionId, Long messageId, String chunk);

    //消息结束
    default void onComplete(Long sessionId, Long messageId) {

    }

    default void onComplete(Long sessionId, Long messageId, AgentOutput output) {
        onComplete(sessionId, messageId);
    }

    //消息异常
    void onError(Long sessionId, Long messageId, String error);

    boolean isStop();
}
